//
//  GLTabbarVC.m
//  Demo
//
//  Created by lishuai on 15/5/18.
//  Copyright (c) 2015年 lishuai. All rights reserved.
//

#import "GLTabbarVC.h"
#import "GLWebViewVC.h"
#import "GLNavigationController.h"

@interface GLTabbarVC ()

@end

@implementation GLTabbarVC

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    
    if (self) {
        
    }
    
    return self;
}

- (instancetype)init {
    self = [super init];
    if (self ) {
        
    }
    
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    GLWebViewVC *vc1 = [[GLWebViewVC alloc] init];
    GLWebViewVC *vc2 = [[GLWebViewVC alloc] init];
    GLWebViewVC *vc3 = [[GLWebViewVC alloc] init];
    GLWebViewVC *vc4 = [[GLWebViewVC alloc] init];
    
    vc1.hidesBottomBarWhenPushed = NO;
    vc2.hidesBottomBarWhenPushed = NO;
    vc3.hidesBottomBarWhenPushed = NO;
    vc4.hidesBottomBarWhenPushed = NO;
    
    vc4.url = [NSURL URLWithString:@"http://www.taobao.com"];
    vc3.url = [NSURL URLWithString:@"http://www.qq.com"];
    vc2.url = [NSURL URLWithString:@"http://www.163.com"];
    vc1.url = [NSURL URLWithString:@"http://jc.aclili.com"];
    
    GLNavigationController *nav1 = [[GLNavigationController alloc] initWithRootViewController:vc1];
    GLNavigationController *nav2 = [[GLNavigationController alloc] initWithRootViewController:vc2];
    GLNavigationController *nav3 = [[GLNavigationController alloc] initWithRootViewController:vc3];
    GLNavigationController *nav4 = [[GLNavigationController alloc] initWithRootViewController:vc4];
    
    vc1.title = @"一起猜";
    vc2.title = @"一起猜";
    vc3.title = @"一起猜";
    vc4.title = @"一起猜";
    
    UITabBarItem *item1 = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:0];
    UITabBarItem *item2 = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:1];
    UITabBarItem *item3 = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:2];
    UITabBarItem *item4 = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:3];

    
    vc1.tabBarItem = item1;
    vc2.tabBarItem = item2;
    vc3.tabBarItem = item3;
    vc4.tabBarItem = item4;
    
    self.viewControllers = @[nav1, nav2,nav3,nav4];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
